package es.cea;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * Application Lifecycle Listener implementation class ListenerTareas
 *
 */
public class ListenerTareas implements ServletContextListener {






	public void contextInitialized(ServletContextEvent arg0) {
    	Tarea tarea1=new Tarea(1, "titulo 1", "descripcion1");
    	Tarea tarea2=new Tarea(2, "titulo 2", "descripcion2");
    	Tarea tarea3=new Tarea(3, "titulo 3", "descripcion3");
    	List<Tarea> tareas=new ArrayList<Tarea>();
    	tareas.add(tarea1);
    	tareas.add(tarea2);
    	tareas.add(tarea3);
    	arg0.getServletContext().setAttribute("tareas", tareas);
    	System.out.println(" lista tareas creada"+tareas);

    }


    public void contextDestroyed(ServletContextEvent arg0) {
        // TODO Auto-generated method stub
    }
	
}
